/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:龙宝
 * Date:2023-11-26
 * Time:11:45
 */
class Alg<T extends Comparable<T>> {
    public T findMaxVal(T[] array) {
        T maxVal = array[0];
        for (int i = 1; i < array.length; i++) {
            if(array[i].compareTo(maxVal) > 0) {
                maxVal = array[i];
            }
        }
        return maxVal;
    }
}
public class test4 {
    public static void main(String[] args) {
        Alg<Integer> a1 = new Alg<>();
        Integer[] arr = {2,4,5,9,10,1};
        Integer ret = a1.findMaxVal(arr);
    }
}
